﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using BCCommon.OAEnums.TeamWork;
using BCEntity.OA.TeamWork.TeamWork;

namespace BCData.OA.TeamWork.TeamWork
{
    /// <summary>
    /// 协同办公
    /// </summary>
    public interface ITeamWorkData
    {
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        Task<bool> Exists(long teamWorkId);
        /// <summary>
        /// 增加协同办公
        /// </summary>
        /// <param name="entity">协同办公信息</param>
        Task<TeamWorkEntity> Add(TeamWorkEntity entity);
        /// <summary>
        /// 更新协同办公
        /// </summary>
        /// <param name="entity">协同办公信息</param>
        Task<TeamWorkEntity> Update(TeamWorkEntity entity);
        /// <summary>
        /// 删除协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        Task<bool> Delete(long teamWorkId);
        /// <summary>
        /// 获取协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        Task<TeamWorkViewEntity> GetEntity(long teamWorkId);
        /// <summary>
        /// 获取协同办公列表
        /// </summary>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        Task<IEnumerable<TeamWorkViewEntity>> GetList(string teamWorkCategoryCode, DateTime? start, DateTime? end);
        /// <summary>
        /// 获取进行中协同办公任务总数
        /// </summary>
        /// <param name="participantId">参与人Id</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <returns></returns>
        Task<int> GetProcessingCount(long participantId, string teamWorkCategoryCode);
        /// <summary>
        /// 获取协同办公分页列表
        /// </summary>
        /// <param name="referenceNo">引用编号</param>
        /// <param name="workTitle">工作标题</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="workStatus">工作状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">协同办公每页数据条数</param>
        Task<(IEnumerable<TeamWorkViewEntity>, int)> Query(string referenceNo, string workTitle, string teamWorkCategoryCode, OAWorkStatus? workStatus, DateTime? start, DateTime? end, int pageIndex, int pageSize);
        /// <summary>
        /// 获取协同办公分页列表
        /// </summary>
        /// <param name="participantId">参与人Id</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="workStatus">工作状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">协同办公每页数据条数</param>
        Task<(IEnumerable<TeamWorkViewEntity>, int)> Query(long participantId, string teamWorkCategoryCode, OAWorkStatus? workStatus, DateTime? start, DateTime? end, int pageIndex, int pageSize);
    }
}
